package com.zhifei.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhifei.common.utils.Constant;
import com.zhifei.system.domain.DevProjectEntity;
import com.zhifei.system.domain.vo.DevProjectVo;
import com.zhifei.system.mapper.DevProjectMapper;
import com.zhifei.system.service.DevProjectService;
import com.zhifei.system.util.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DevProjectServiceImpl extends ServiceImpl<DevProjectMapper, DevProjectEntity> implements DevProjectService {

    @Autowired
    private DevProjectMapper devProjectMapper;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page page = new Page(Long.parseLong((String)params.get(Constant.PAGE)),Long.parseLong((String)params.get(Constant.LIMIT)));
        String customerName = (String) params.get("customerName");
        String projectName = (String) params.get("projectName");
        String orderNo = (String) params.get("orderNo");
        String orderStartDate = (String) params.get("orderStartDate");
        String orderEndDate = (String) params.get("orderEndDate");
        List<DevProjectVo> devProjectVoList = devProjectMapper.queryPage(page,customerName,projectName,orderNo,orderStartDate,orderEndDate);
        page.setRecords(devProjectVoList);
        return new PageUtils(page);
    }

}
